﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;

namespace PDFWriter
{
    class Program
    {
        static void Main(string[] args)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("../../pdf.xml");
            //Console.WriteLine(doc.InnerXml);
            PDFEngine root = new PDFEngine(doc.InnerXml);
            //PDFCatalog root = new PDFCatalog();
            //PDFDictionary root = new PDFDictionary();
            //DocumentRoot root = new DocumentRoot();
            //PDFFont root = new PDFFont();
            //PDFResource root = new PDFResource();
            //PDFPageContent root = new PDFPageContent();
           // PDFStream root = new PDFStream();
            //DocumentPage root = new DocumentPage();
            string str = "";
            foreach (PDFObject item in root.GetPDFObjects())
                        {
                            //Console.WriteLine(item.Text);
                str += item.Text+"\n";
                        }
            

            //Console.WriteLine(root.GetPDFObject().Text);
            File.WriteAllText("../../hello.pdf",str);
            Console.ReadLine();
        }
    }
}
